const Mock = require('mockjs')

const RenewInsuranceList=[];
for(let i=0;i<100;i++){
    RenewInsuranceList.push(
        Mock.mock({
            id:'@increment',
            number:'@integer(111111,999999)',
            type:'@first',
            licenseplate:'@first',
            carowner:'@first',
            company:'@first',
            commercial:'@integer(10,9999)',
            compulsory:'@integer(10,999)',
            tax:'@integer(10,999)',
            shop:'@integer(10,999)',
            guider:'@first',
            state:'@integer(0,1)',
            remark:'',
            createtime:'@datetime'
        })
    )
}




module.exports=[
    {
        url: '/api/finance/renewinsurance',
        type: 'get',
        response: config => {
          const { name, page = 1, limit = 20, sort } = config.query
    
          let mockList = RenewInsuranceList.filter(item => {
            return true
          })

    
          const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
    
          return {
            code: '10000',
            data: {
              total: mockList.length,
              items: pageList
            }
          }
        }
    },
]